var ns, app;
app = new Vue({
    el: '#app',
    data: {
        id: 0,
        form:{},
        startTime: '', //开始日期
        endTime: '', //结束日期
    },
    methods: {
        get_data: function () {
            var that = this;
            var options = {};
            options.id = that.id;
            options.startTime = that.startTime;
            options.endTime = that.endTime;
            console.log(JSON.stringify(options));
            ns.post(options, function (succeed, data, err) {
                console.log(JSON.stringify(data));
                if (succeed) {
                    that.form = data;
                    // if(data.status){
                    //     that.form = data.UserStaffInfo;
                    // }else{
                    //     api.toast({
                    //         msg: '接口报错',
                    //         duration: 2000,
                    //         location: 'bottom'
                    //     });
                    // }
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });

                }
            }, {
                toast: true,
                command: 'App/Service/KPIDetail'
            });
        },
       

    }
});
apiready = function () {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.id = api.pageParam.id;
    app.startTime = api.pageParam.startTime;
    app.endTime = api.pageParam.endTime;
    app.get_data();
};
